Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Plot #94

wants to merge 2 commits into from

Conversation

Ananas120
Copy link

Plot example code
To test it, i put the topology from the TP in examples/topo_tp.json so you can try the code by running :

from ipmininet.plot_utils import to_graphviz
g = to_graphviz(‘ipmininet/examples/topo_tp.json’, filename =plot_test.gv’)
g.view()
g # if you are in a jupyter notebook, it will show the plot

@jadinm
Copy link
Collaborator

jadinm commented Nov 9, 2020

I am sceptical about using a json file as an argument
Wouldn't it be better to enable users to display the graph from an IPTopo object directly than requiring an additional file from them ?

Also, it would be better not to have hardcoded paths such as the variable _graphviz_path

@Ananas120
Copy link
Author

Yes indeed, my first target was to do it based on a IPTopo class but i didn’t find the information of AS in the class
Furthermore, the « json » idea is also related to my class JSONTopo i created for the project which also take a json file and automatically create the topology (which is far more powerful than hardcode all routers / hosts / AS / ...) but i will post it only at the end of the project

So the idea of this plot was to use the json file to 1) create the topology based on JSONTopo class and 2) plot the topology based on the same json file and 3) based on the JSONTopo class, get many informations about the topology (number of iBGP / eBGP connections, number of links / RR / ...)

@jadinm
Copy link
Collaborator

jadinm commented Nov 10, 2020

Yes indeed, my first target was to do it based on a IPTopo class but i didn’t find the information of AS in the class
Furthermore, the « json » idea is also related to my class JSONTopo i created for the project which also take a json file and automatically create the topology (which is far more powerful than hardcode all routers / hosts / AS / ...) but i will post it only at the end of the project

You can have access to this by using the instance variable topology.overlays
Then, you can check the type of the Overlay with isinstance()
If this is an AS object, then you have access to what you want :)

@Ananas120
Copy link
Author

Ok thank you, then i will try to convert a IPTopo to a json file it can be good to visualize the topology etc !
I will not have the time to do it before the end of the project but maybe after when posting the JSONTopo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants